home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 June / Cd Pc Users 9.iso / prog / inst / baslibs / basmouse.bas < prev    next >
Encoding:
BASIC Source File  |  1996-07-23  |  1.0 KB  |  54 lines

  1. Attribute VB_Name = "basMouse"
  2. Option Explicit
  3.  
  4. '  Mouse/cursor functions.
  5.  
  6. Private lShowCursor As Long
  7. Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
  8.  
  9. '
  10. '  Hides the mouse cursor.
  11. '
  12. Public Sub HideMouse()
  13.    Dim result As Integer
  14.    
  15.    Do
  16.       lShowCursor = lShowCursor - 1
  17.       result = ShowCursor(False)
  18.    Loop Until result < 0
  19.    
  20. End Sub
  21.  
  22. '
  23. '  Restores the mouse cursor to it's previous state regardless
  24. '  if HideMouse and ShowMouse were called.
  25. '
  26. Public Sub RestoreMouse()
  27.    If lShowCursor > 0 Then
  28.       Do While lShowCursor <> 0
  29.          ShowCursor (False)
  30.          lShowCursor = lShowCursor - 1
  31.       Loop
  32.    ElseIf lShowCursor < 0 Then
  33.       Do While lShowCursor <> 0
  34.          ShowCursor (True)
  35.          lShowCursor = lShowCursor + 1
  36.       Loop
  37.    End If
  38. End Sub
  39.  
  40.  
  41. '
  42. '  Show's the mouse cursor.
  43. '
  44. Public Sub ShowMouse()
  45.    Dim result
  46.    
  47.    Do
  48.       lShowCursor = lShowCursor - 1
  49.       result = ShowCursor(True)
  50.    Loop Until result >= 0
  51.  
  52. End Sub
  53.  
  54.